package com.itheima.mapper;

import com.itheima.pojo.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeptMapper {

    /**
     * 查询部门列表
     * @return
     */
   public List<Dept> list();

    /**
     * 根据Id 删除部门
     * @param id
     */
    @Delete("delete from dept where id=#{id}")
    void deleteById(Integer id);

    /**
     * 添加部门
     * @param dept
     */
    void add(Dept dept);

    /**
     * 根据Id查询部门
     * @param id
     * @return
     */
    @Select("select * from dept where id=#{id}")
    Dept getById(Integer id);

    void update(Dept dept);
}
